const get=require('./get');
const config=require('../config');
const cheerio=require('cheerio');

module.exports=async (cat)=>{

    let res=await get(config.catUrl,{cat:cat.id});

    let $=cheerio.load(res.data);
    let total=Number($('#J_topPage').find('i').eq(0).text());
    if(Number.isNaN(total))return null;

    return {cat,totalPaging:total};
};
